{% extends "base.html" %}
{% block body %}
<div class="card border border-dark shadow" id="c2profiles_table" style="margin-top:5px">
    <div class="card-header border border-dark bg-header text-white shadow">
        <h2 style="display:inline-block"><span class="operator">Global C2 Profile</span> Configurations</h2>
    </div>
    <div class="card-body border border-dark bg-card-body shadow" style="padding:0;max-height:calc(82vh);overflow-y:auto">
        <table style="width:100%;margin-bottom:0" class="table table-striped {{config['table-color']}} border border-dark shadow">
            <tr v-for="p in profiles" :key="p.id">
                <td style="text-align:left;padding-left:10px">
                    <br>
                    <template v-if="p.container_running">
                        <div class="led-green" style="display:inline-block" data-toggle="tooltip" title="This indicates the Docker container is running"></div>
                    </template>
                    <template v-else>
                        <div class="led-red" style="display:inline-block" data-toggle="tooltip" title="No heartbeat from container in over 30 seconds"></div>
                    </template>
                    <h3 style="display:inline-block;padding-left:10px">[[p.name]]</h3><br>
                    <pre style="word-wrap:break-word;white-space:pre-wrap;display:inline-block">Supported Payloads: [[p.payload_types.join(", ")]]</pre><br>
                    <pre style="word-wrap:break-word;white-space:pre-wrap">Author: [[p.author]]</pre><br>
                    <pre style="word-wrap:break-word;white-space:pre-wrap">[[p.description]]</pre><br>
                </td>
                <td style="text-align:center"><br><br>
                    {% if view_mode != 'spectator' %}
                    <template v-if="p.running">
                         <div class="dropdown" style="display:inline">
                                <button class="btn btn{{config['outline-buttons']}}danger dropdown-toggle btn-sm" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"  :data-target="p.name + 'stop_button'">
                                <i class="fas fa-edit"> Internal Server</i>
                              </button>
                              <div class="dropdown-menu" :id="p.name + 'stop_button'">
                                  <button class="dropdown-item"  @click="running_button(p)">Stop Internal Server</button>
                                  <button class="dropdown-item"  @click="check_status_button(p)">View Stdout/Stderr</button>
                              </div>
                         </div>
                    </template>
                    <template v-else-if="!p.running && p.container_running">
                        <button class="btn btn{{config['outline-buttons']}}secondary btn-sm"  @click="running_button(p)">Start Internal Server</button>
                    </template>
                    <template v-else>
                        <button disabled class="btn btn{{config['outline-buttons']}}info btn-sm">Can't Start Server</button>
                    </template>
                    {% endif %}
                    <br><br>
                </td>
                <td style="text-align:center"><br><br>
                    {% if view_mode == 'developer' %}
                     <div class="dropdown" style="display:inline">
                        <button class="btn btn{{config['outline-buttons']}}secondary dropdown-toggle btn-sm" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" :data-target="p.name + 'edit_button'">
                            <i class="fas fa-edit"></i> Configure
                          </button>
                          <div class="dropdown-menu" :id="p.name + 'edit_button'">
                              <button class="dropdown-item" @click="update_button(p)">View Info</button>
                              <button class="dropdown-item" @click="parameters_button(p)">View Parameters</button>
                              <template v-if="p.container_running">
                                  <button class="dropdown-item" @click="configure_server(p)">Configure Server</button>
                              </template>
                                <button class="dropdown-item" @click="delete_button(p)"><i class="fas fa-trash-alt"></i> Delete Profile</button>
                          </div>
                     </div>
                    {% endif %}
                    {% if view_mode == 'operator' %}
                    <div class="dropdown" style="display:inline">
                        <button class="btn btn{{config['outline-buttons']}}warning dropdown-toggle btn-sm" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" :data-target="p.name + 'edit_button'">
                            <i class="fas fa-edit"></i> Configure
                          </button>
                          <div class="dropdown-menu" :id="p.name + 'edit_button'">
                              <button class="dropdown-item" @click="update_button(p)">View Info</button>
                              <button class="dropdown-item" @click="parameters_button(p)">View Parameters</button>
                              <template v-if="p.container_running">
                                  <button :disabled="!p.container_running" class="dropdown-item" @click="configure_server(p)">Configure Server</button>
                              </template>
                          </div>
                     </div>
                    {% endif %}
                    <a class="btn btn{{config['outline-buttons']}}info btn-sm" :href="'/docs/c2-profiles/' + p.name.toLowerCase()" target="_blank" data-toggle="tooltip" title="View Documentation" style="display:inline-block"><i class="fas fa-file-alt"></i> </a>
                </td>
                <td style="text-align:center"><br>
                    Saved instances:
                    <template v-if="p.instances !== undefined">
                        [[ Object.keys(p.instances).length ]]
                    </template>
                    <template v-else>
                        0
                    </template>
                    <br>
                    <div class="dropdown" style="display:inline">
                        <button class="btn btn{{config['outline-buttons']}}secondary dropdown-toggle btn-sm" data-boundary="viewport" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" :data-target="p.name + 'instances'">
                            <i class="fa fa-bookmark"></i> Save Instance
                          </button>
                          <div class="dropdown-menu" :id="p.name + 'instances'">
                              {% if view_mode != 'spectator' %}
                              <button class="dropdown-item" @click="create_new_parameter_instance_button(p)">Create Instance</button>
                              {% endif %}
                              <button class="dropdown-item" @click="edit_parameter_instance_button(p)">View/Delete Instance</button>
                          </div>
                     </div>
                </td>
            </tr>
        </table>
    </div>
</div>

<!-- THIS IS OUR MODAL FOR DELETING PROFILE -->
<div class="modal fade" id="profileDeleteModal" role="dialog">
    <div class="modal-dialog modal-md" role="document">
        <div class="modal-content">
            <div class="modal-header bg-dark text-white">
                <h3 id="modalLabel">Are you sure? </h3>
                <button type="button" class="close" data-dismiss="modal">×</button>
            </div>
            <div class="modal-body">
                Remove the specified C2 Profile from the database. This does NOT delete or stop the container.
            </div>
              <div class="modal-footer">
                <button class="btn btn{{config['outline-buttons']}}warning" data-dismiss="modal" aria-hidden="true">Cancel</button>
                <button class="btn btn{{config['outline-buttons']}}danger" data-dismiss="modal" id="profileDeleteSubmit">Submit</button>
              </div>
        </div>
    </div>
</div>
<!-- END MODAL FOR DELETING PROFILE -->
<!-- THIS IS OUR MODAL FOR UPDATING A PROFILE -->
<div class="modal fade" id="profileUpdateModal" role="dialog">
    <div class="modal-dialog modal-xl" role="document">
	<div class="modal-content">
	    <div class="modal-header bg-dark text-white">
		<h3 id="updateLabel">View the current C2 profile</h3>
	    <button type="button" class="close" data-dismiss="modal">x</button>
        </div>
	    <div class="modal-body" id="profileUpdateBody">
            View the current profile's description, and/or supported payload types.
            <table style="width:100%" class="table-striped {{config['table-color']}} table">
                <tr>
                    <td style="width:300px">Name</td>
                    <td><input class="form-control" type="text" v-model="name" size="50" disabled></td>
                </tr>
                <tr>
                    <td>Description</td>
                    <td> <textarea disabled class="form-control" type="text" v-model="description" cols="100"></textarea></td>
                </tr>
                <tr>
                    <td>Supported Payloads</td>
                    <td>
                        <table>
                            <tr v-for="(p, i) in edit_payload_file_list">
                                <td>[[p.name]]</td>
                                <td style="padding-left:10px;padding-top:10px">
                                    <span class="material-switch pull-right">
                                        <input disabled class="form-control" type="checkbox" v-model="p.active" :id="'editsupported' + i">
                                        <label :for="'editsupported' + i" class="btn-success">
                                        </label>
                                    </span>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>Author (twitter handle)</td>
                    <td><input class="form-control" disabled type="text" v-model="author" size="50"></td>
                </tr>
                <tr>
                    <td>Is this a P2P profile?</td>
                    <td><span class="material-switch pull-right"><input class="form-control" disabled type="checkbox" v-model="is_p2p" id="profileUpdateIsP2P"><label for="profileUpdateIsP2P" class="btn-info"></label></span></td>
                </tr>
                <tr v-if="is_p2p">
                    <td>Is this Server Routed?</td>
                    <td><span class="material-switch pull-right"><input class="form-control" disabled type="checkbox" v-model="is_server_routed" id="profileUpdateIsServerRouted"><label for="profileUpdateIsServerRouted" class="btn-info"></label></span></td>
                </tr>
            </table>
        </div>
	    <div class="modal-footer">
		<button class="btn btn{{config['outline-buttons']}}primary" data-dismiss="modal" id="profileUpdateSubmit">Close</button>
	    </div>
	</div>
    </div>
</div>
<!-- END MODAL FOR UPDATING A PROFILE -->
<!-- THIS IS OUR MODAL FOR EDITING A PROFILE'S PARAMETERS -->
<div class="modal fade" id="profileEditParametersModal" role="dialog">
    <div class="modal-dialog modal-xl" role="document" style="max-width:100%">
	<div class="modal-content">
	    <div class="modal-header bg-dark text-white">
		<h3>View Profile Parameters</h3>
	    <button type="button" class="close" data-dismiss="modal">x</button>
        </div>
	    <div class="modal-body" id="profileEditParametersBody">
            C2 profiles can have parameters that can get stamped in at payload creation time. Here, you will specify the "description" that will be presented to the user for the parameter and the "name" that will be stamped out when the profile is created.
            <div id="profileEditParametersTable">
                <table cellpadding="10" style="width:100%" class="table-striped {{config['table-color']}} table">
                    <tr>
                        <th style="width:20rem"><b>Name</b></th>
                        <th style="width:20rem"><b>Description</b></th>
                        <th><b>Instance Configuration</b></th>
                    </tr>
                    <tr v-for="(i,p) in parameters" :key="p">
                        <td>
                            <input disabled class="form-control" type="text" :value="i.name" v-model="i.name" style="width:100%">
                        </td>
                        <td>
                            <input disabled class="form-control" type="text" :value="i.description" v-model="i.description" style="width:100%">
                        </td>
                        <td style="padding-left:20px">
                            Parameter Type:
                            <select disabled class="form-control" v-model="i.parameter_type">
                                <option v-for="o in parameter_type_options" :value="o">[[o]]</option>
                            </select>
                            Default Value:
                            <textarea disabled class="form-control" type="text" :value="i.default_value" v-model="i.default_value" style="width:100%"></textarea>
                            Is Parameter Required to be supplied?
                            <span style="padding-left:20px;" class="material-switch pull-right">
                                <input class="form-control" disabled type="checkbox" v-model="i.required" :value="i.required" :id="'paramreq' + p">
                            <label :for="'paramreq' + p" class="btn-info"></label></span><br>
                            <template v-if="i.required">
                                Supply a regex that the value must match to be considered valid:
                                <textarea class="form-control" disabled type="text" :value="i.verifier_regex" v-model="i.verifier_regex" style="width:100%"></textarea>
                            </template>
                            Should Parameter be randomized for each instance?
                            <span style="padding-left:20px;" class="material-switch pull-right">
                                <input class="form-control" disabled type="checkbox" v-model="i.randomize" :value="i.randomize" :id="'paramrand' + p">
                            <label :for="'paramrand' + p" class="btn-info"></label></span><br>
                            <template v-if="i.randomize">
                                Randomization Regex - On each instance, a new value matching the below regex will be generated:
                                 <input class="form-control" disabled type="text" :value="i.format_string" v-model="i.format_string" style="width:100%">
                            </template>

                            <template v-if="i.crypto_type">
                                In your build function, for this parameter you will get a dictionary with the following information:
                                 <textarea disabled class="form-control" type="text" style="width:100%" rows="5">
{
  "enc_key": "base64 of encryption key or None",
  "dec_key": "base64 of decryption key or None",
  "value": "the choice the user selected from the choices in the default value section above"
}</textarea>
                            </template>
                            <template v-else-if="i.parameter_type === 'Dictionary'">
                                In your build function, for this parameter you will get an array with the following information. You can either use something like "json.dumps" to dump the entire array as a string into your agent code or you can iterate over it and leverage each key and value as you need throughout your code.
                                <textarea disabled class="form-control" type="text" style="width:100%" rows="12">
[
{
  "name": "Temporary name that the user sees. This will often match the key unless the user is able to add their own",
  "key": "The final name for the key to be used",
  "value": "The final value that the user wrote in or left as default",
  "custom": true or false
},
{
  "name": "Temporary name that the user sees. This will often match the key unless the user is able to add their own",
  "key": "The final name for the key to be used",
  "value": "The final value that the user wrote in or left as default",
  "custom": true or false
}
</textarea>
                                You will likely only need the "key" and "value" elements from each of these dictionaries, but the other components are provided in case you want to easily check if an entry was one you supplied or one the user added in.
                            </template>
                            <template v-else-if="i.parameter_type === 'ChooseOne'">
                                In your build function, for this parameter you will get whichever option the user chose. The default choice is the first one in the list.
                            </template>
                            <template v-else-if="i.parameter_type === 'Date'">
                                In your build function, for this parameter you will get a string representation of a date in the format YYYY-MM-DD. The default value supplied for this indicates how many days +/- from the current date that should be auto populated. For example, a default value of 365 will provide a default date one year in the future.
                            </template>
                            <template v-else>
                                In your build function, for this parameter you will get a string value with whatever the user supplied (or an empty string if they left it blank)
                            </template>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
	    <div class="modal-footer">
		<button class="btn btn{{config['outline-buttons']}}primary" data-dismiss="modal">Close</button>
	    </div>
	</div>
    </div>
</div>
<!-- END MODAL FOR EDITING A PROFILE'S PARAMETERS -->
<br>
<div id="instances_table">
    <!-- THIS IS OUR MODAL FOR EDITING A PROFILE'S PARAMETERS -->
    <div class="modal fade" id="profileCreateInstanceModal" role="dialog">
        <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header bg-dark text-white">
            <h3>Provide Instance Values and Instance Name</h3>
            <button type="button" class="close" data-dismiss="modal">x</button>
            </div>
            <div class="modal-body">
                Provide values for this C2 profile that can be used to auto-populate fields when creating payloads later. This helps save time so you don't have to type out the values each time you create a payload.
                    <table cellpadding="10" style="width:100%" class="table-striped {{config['table-color']}} table">
                        <tr>
                            <th><b>Name</b></th>
                            <th><b>Value</b></th>
                        </tr>
                        <tr>
                            <td><input class="form-control" disabled type="text" value="Instance Name: " style="width:100%"></td>
                            <td>
                                <input class="form-control" type="text" :value="current_name" v-model="current_name" style="width:100%">
                            </td>
                        </tr>
                        <tr v-for="(i,p) in current_parameters" :key="'params' + p">
                            <td style="width:40%;padding-left:10px">
                                [[i.name]]
                                <template v-if="i.required">
                                    <font color="indianred"><br><b>(Required)</b></font>
                                </template>
                            </td>
                            <td>
                                <template v-if="i.parameter_type === 'String'">
                                    <template v-if="!passing_requirements(i)">
                                        <font color="indianred"><b>(Bad Value)</b></font>
                                    </template>
                                    <textarea class="form-control" :id="'paraminst' + p" oninput="adjust_size(this)" rows="2" :value="i.parameter" v-model="i.parameter" style="white-space: nowrap; width:100%"></textarea>
                                </template>
                                <template v-else-if="i.parameter_type === 'ChooseOne'">
                                    <select class="form-control" v-model="i.parameter">
                                        <option v-for="o in i.default_value.split('\n')" :value="o">[[o]]</option>
                                    </select>
                                </template>
                                <template v-else-if="i.parameter_type === 'Date'">
                                    <div class='input-group date' data-provide="datepicker" :id="'newparaminst' + i.id" data-date-format="yyyy-mm-dd" data-date-today-highlight="true" data-date-autoclose="true" onchange="instances_table.update(event)">
                                        <input type="text" class="form-control" :value="i.parameter" v-model="i.parameter">
                                        <div class="input-group-append">
                                            <button class="btn btn-sm btn{{config['outline-buttons']}}secondary"><i class="far fa-calendar-alt fa-2x"></i></button>
                                        </div>
                                    </div>
                                </template>
                                <template v-else-if="i.parameter_type === 'Array'">
                                    <template v-if="!passing_requirements(i)">
                                        <font color="indianred"><b>(Bad Value)</b></font>
                                    </template>
                                    <div v-for="(e, index) in i.parameter">
                                        <div class="input-group">
                                            <button class="btn btn-sm btn{{config['outline-buttons']}}danger" @click="remove_array_element(i, index) "><i class="far fa-trash-alt"></i></button>
                                            <input type="text" class="form-control" v-model="i.parameter[index]" :value="i.parameter[index]">
                                        </div>
                                    </div>
                                    <button class="btn btn-sm btn{{config['outline-buttons']}}success" @click="add_array_element(i.parameter)"><i class="fa fa-plus"></i></button>
                                </template>
                                <template v-else-if="i.parameter_type === 'Dictionary'">
                                    <template v-for="(o, index) in i.parameter">
                                        <div class="input-group">
                                            <button class="btn btn-sm btn{{config['outline-buttons']}}danger" @click="remove_dict_element(i, index)"><i class="far fa-trash-alt"></i></button>
                                            <button disabled class="btn btn-sm btn-secondary">Key:</button>
                                            <template v-if="o['custom']">
                                                <input type="text" :value="o['key']" class="text form-control" v-model="i.parameter[index]['key']">
                                            </template>
                                            <template v-else>
                                                <input disabled :value="o['name']" class="text form-control">
                                            </template>
                                            <button disabled class="btn btn-sm btn-secondary">Value:</button>
                                            <input type="text" class="form-control" :value="o['value']" v-model="o['value']">
                                        </div>
                                    </template>
                                    <template v-if="can_add_more(i)">
                                        <div class="input-group">
                                            <button class="btn btn-sm btn{{config['outline-buttons']}}success" @click="add_dict_element(i)"><i class="fa fa-plus"></i></button>
                                            <button disabled class="btn btn-sm btn-secondary">New key of type:</button>
                                            <select v-model="i['new_key']" class="form-control">
                                                <option v-for="o in add_options(i)" :value="o">
                                                    <template v-if="o === '*'">
                                                        Custom
                                                    </template>
                                                    <template v-else>
                                                        [[ o ]]
                                                    </template>
                                                </option>
                                            </select>

                                        </div>
                                    </template>
                                </template>
                            </td>
                        </tr>
                    </table>
            </div>
            <div class="modal-footer">
            <button class="btn btn{{config['outline-buttons']}}warning" data-dismiss="modal" aria-hidden="true">Cancel</button>
            <button class="btn btn{{config['outline-buttons']}}primary" data-dismiss="modal" id="profileCreateInstanceSubmit">Submit</button>
            </div>
        </div>
        </div>
    </div>
    <!-- END MODAL FOR EDITING A PROFILE'S PARAMETERS -->
    <!-- THIS IS OUR MODAL FOR EDITING A PROFILE'S PARAMETERS -->
    <div class="modal fade" id="profileEditInstanceModal" role="dialog">
        <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header bg-dark text-white">
            <h3>Provide Instance Values and Instance Name</h3>
            <button type="button" class="close" data-dismiss="modal">x</button>
            </div>
            <div class="modal-body">
                Provide values for this C2 profile that can be used to auto-populate fields when creating payloads later. This helps save time so you don't have to type out the values each time you create a payload.
                <br>Select instance: <select class="form-control" v-model="current_name" style="width:auto">
                <option v-for="n in instance_options()" :value="n.instance_name">[[n.instance_name]]</option>
            </select>
                <table cellpadding="10" style="width:100%" class="table-striped {{config['table-color']}} table">
                        <tr>
                            <th><b>Name</b></th>
                            <th><b>Value</b></th>
                        </tr>
                        <tr>
                            <td><input class="form-control" disabled type="text" value="Instance Name: " style="width:100%"></td>
                            <td>
                                <input class="form-control" disabled type="text" :value="current_name" v-model="current_name" style="width:100%">
                            </td>
                        </tr>
                        <tr v-for="(i,p) in current_parameters" :key="'params' + p">
                            <td style="width:40%;padding-left:10px">
                                [[i.name]]
                                <template v-if="i.required">
                                    <font color="indianred"><br><b>(Required)</b></font>
                                </template>
                            </td>
                            <td>
                                <template v-if="i.parameter_type === 'String'">
                                    <template v-if="!passing_requirements(i)">
                                        <font color="indianred"><b>(Bad Value)</b></font>
                                    </template>
                                    <textarea class="form-control" :id="'paraminstedit' + p" oninput="adjust_size(this)" rows="2" :value="i.value" v-model="i.value" style="white-space: nowrap; width:100%"></textarea>
                                </template>
                                <template v-else-if="i.parameter_type === 'ChooseOne'">
                                    <select class="form-control" v-model="i.value">
                                        <option v-for="o in i.default_value.split('\n')" :value="o">[[o]]</option>
                                    </select>
                                </template>
                                <template v-else-if="i.parameter_type === 'Date'">
                                    <div class='input-group date' data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-today-highlight="true" data-date-autoclose="true">
                                        <input class="form-control" :value="i.parameter" v-model="i.parameter">
                                        <div class="input-group-append">
                                            <button disabled class="btn btn-sm btn{{config['outline-buttons']}}secondary"><i class="far fa-calendar-alt fa-2x"></i></button>
                                        </div>
                                    </div>
                                </template>
                                <template v-else-if="i.parameter_type === 'Array'">
                                    <template v-if="!passing_requirements(i)">
                                        <font color="indianred"><b>(Bad Value)</b></font>
                                    </template>
                                    <div v-for="(e, index) in i.parameter">
                                        <div class="input-group">
                                            <button disabled class="btn btn-sm btn{{config['outline-buttons']}}danger" @click="remove_array_element(i, index) "><i class="far fa-trash-alt"></i></button>
                                            <input type="text" class="form-control" v-model="i.parameter[index]" :value="i.parameter[index]">
                                        </div>
                                    </div>
                                    <button disabled class="btn btn-sm btn{{config['outline-buttons']}}success" @click="add_array_element(i.parameter)"><i class="fa fa-plus"></i></button>
                                </template>
                                <template v-else-if="i.parameter_type === 'Dictionary'">
                                    <template v-for="(o, index) in i.parameter">
                                        <div class="input-group">
                                            <button disabled class="btn btn-sm btn{{config['outline-buttons']}}danger" @click="remove_dict_element(i, index)"><i class="far fa-trash-alt"></i></button>
                                            <button disabled class="btn btn-sm btn-secondary">Key:</button>
                                            <template v-if="o['custom']">
                                                <input type="text" :value="o['key']" class="text form-control" v-model="i.parameter[index]['key']">
                                            </template>
                                            <template v-else>
                                                <input disabled :value="o['name']" class="text form-control">
                                            </template>
                                            <button disabled class="btn btn-sm btn-secondary">Value:</button>
                                            <input type="text" class="form-control" :value="o['value']">
                                        </div>
                                    </template>
                                    <template v-if="can_add_more(i)">
                                        <div class="input-group">
                                            <button disabled class="btn btn-sm btn{{config['outline-buttons']}}success" @click="add_dict_element(i)"><i class="fa fa-plus"></i></button>
                                            <button disabled class="btn btn-sm btn-secondary">New key of type:</button>
                                            <select disabled v-model="i['new_key']" class="form-control">
                                                <option v-for="o in add_options(i)" :value="o">
                                                    <template v-if="o === '*'">
                                                        Custom
                                                    </template>
                                                    <template v-else>
                                                        [[ o ]]
                                                    </template>
                                                </option>
                                            </select>
                                        </div>
                                    </template>
                                </template>
                            </td>
                        </tr>
                    </table>
            </div>
            <div class="modal-footer">
            <button class="btn btn{{config['outline-buttons']}}warning" data-dismiss="modal" aria-hidden="true">Cancel</button>
            <button class="btn btn{{config['outline-buttons']}}danger" data-dismiss="modal" id="profileEditInstanceSubmit">Delete</button>
            </div>
        </div>
        </div>
    </div>
    <!-- END MODAL FOR EDITING A PROFILE'S PARAMETERS -->
</div>
<!-- THIS IS OUR MODAL FOR DELETING PROFILE -->
<div class="modal fade" id="stdoutStderrModal" role="dialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header bg-dark text-white">
                <h3>C2 Profile STDOUT/ STDERR Messages</h3>
                <button type="button" class="close" data-dismiss="modal">×</button>
            </div>
            <div class="modal-body" id="stdoutStderrBody" style="height:100%;overflow-y:scroll">
                <b>Messages will disappear when this dialog is closed.<br>Received Message</b>:<br>
                <pre style='white-space:pre-wrap' id="stdoutstderrText"></pre>
            </div>
              <div class="modal-footer">
                <button class="btn btn{{config['outline-buttons']}}primary" data-dismiss="modal">OK</button>
              </div>
        </div>
    </div>
</div>
<!-- END MODAL FOR DELETING PROFILE -->
<!-- THIS IS OUR MODAL FOR EDITING PROFILE FILES -->
<div class="modal fade" id="profileFilesModal" role="dialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header bg-dark text-white">
                <h3>[[profile_name]]'s Configuration File</h3>
                <button type="button" class="close" data-dismiss="modal">×</button>
            </div>
            <div class="modal-body">
                <div style="display:inline-block;width:100%">
                    Theme: <select class="form-control" v-model="theme"><option v-for="t in theme_options" :value="t">[[t]]</option></select>
                    <ace-editor v-model="code" min-lines="3" max-lines="200" :theme="theme" :mode="language"></ace-editor>
                </div>
            </div>
              <div class="modal-footer">
                  <button class="btn btn{{config['outline-buttons']}}warning" data-dismiss="modal" aria-hidden="true">Cancel</button>
                <button class="btn btn{{config['outline-buttons']}}success" id="profileFilesSubmit" data-dismiss="modal" aria-hidden="true">Update</button>
              </div>
        </div>
    </div>
</div>
<!-- END MODAL FOR EDITING PROFILE FILES-->

{% endblock %}

{% block scripts %}
{% include "c2profile_management.js" %}
{% endblock %}

{% block body_config %}
.datepicker {
    background-color: white;
}
{% endblock %}